package com.llxz.blog.ucenter.controller;

import com.llxz.blog.ucenter.entity.User;
import com.llxz.blog.ucenter.service.RelationService;
import com.llxz.blog.util.JwtUtils;
import com.llxz.blog.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 *
 * @author lyq
 * @description: 关系控制器
 * date: 2021/9/4 15:33
 */

@RestController
@RequestMapping("/ucenter/relation")
public class RelationController {
    @Autowired
    RelationService relationService;

    @PostMapping("findAll")
    public R findAll(HttpServletRequest request){
        String id = JwtUtils.getData(request);
        List<User> result = relationService.findAll(id);
        return R.ok().data("items",result);
    }


}